Resolve ASP.NET login redirects to wrong page by fixing authentication cookie and middleware ordering in Startup.cs.